import config from '../config/config.js'

const msgTool = {
	message: (msg) => { 
		uni.showToast({
			title: msg,
			icon: 'none',
			duration: config.msgTimeout
		});
	},
	error: (msg) => {
		uni.showToast({
			title: msg,
			icon: 'none',
			duration: config.msgTimeout
		});
	},
	loading: (msg) => {
		uni.showToast({
			title:msg,
			icon:'loading',
			duration:config.msgTimeout
		});
	},
	success: (msg) => {
		uni.showToast({
			title:msg,
			icon:'success',
			duration:config.msgTimeout
		});
	},
	comfirm: (title, msg, success, failed) => {
		uni.showModal({
			title: title,
			content: msg,
			confirmColor: '#0081FF',
			success: success,
			fail: failed,
			complete: () => {
				uni.hideModal();
			}
		});
	},
	msgConfirm:(title, success, failed) => {
		uni.showModal({
			title:title,
			success:success,
			failed:failed
		});
	}
}
export default msgTool